<?		
	global $sql,$pub;
	require "view/objects/news.class.php";
	$news 		= new news();
	$menuleftHD		= $news->GetLeftMenuHD();
	$menuleftDC		= $news->GetLeftMenuDC($m[1]);
	$menuleftmovie	= $news->GetLeftMenuMovie();
	

	$action		= PATH_HTTP."Forgetpass/";	
	if($_REQUEST['re_send']!=""){
		$email		= $_REQUEST['re_email'];
		$dateadd	= date("Y/m/d H:i");
		$subject	= "Chào bạn";
		$content	= "Nhận lại mật khẩu cho lần đăng nhập";
		$result	= $sql->query('SELECT * FROM user_khachhang WHERE user_email='.$email.'');
		if($result>0){
			//Send mail
				$to 		= $email;
				$from 		= "toanfit@yahoo.com";
				$title 		= $subject;	
					
				$Headers="From:".$from."\n";
				$Headers.="Reply-To:".$from."\n";			
				$Headers.="Content-Type: text/html; charset=\"UTF-8\"; boundary=\"MIME_BOUNDRY\"\n";
				$Headers.="X-Sender:".$title."\n";
				$Headers.="X-Mailer: PHP5\n"; 
				$Headers.="X-Priority: 3\n"; 
				$Headers.="Return-Path:".$from."\n";
				$Subject = $subject;
				$pass=rand(5,10);
				$content .= "============== CONTACT FROM =====================<br />
							
							".EMAIL." : ".$email."<br>
							".PASSWORD.":".$pass."<br>
							<a href='".WEBSITE."'>".WEBSITE."</a><br>				
													
							===========================================================<br />";
				
				$content.= date('d-m-y H:i')."<br />";
				
			if(mail($to,$Subject,$content,$Headers)) {							
				
				$html = $pub->direct("".PATH_HTTP."","Checkmail để nhận lại mật khẩu");
			}else{
				$html = $pub->direct("".PATH_HTTP."","Đăng ký không thành công");
			}
		}
	}
?>